<?php
namespace jy_aligroup;
defined('BY_JYA') or exit('error');
/*
	任务
*/
class task extends \plugin{
	/*
		团UP
	*/
	public function teamup(){
		$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>0);
		$team = pdo_getall('jy_aligroup_groups_team',$params,array('id','groupid','createtime'));
		if($team){
			foreach($team as $a){
				$timeout=pdo_getcolumn('jy_aligroup_groups',array('uniacid'=>$_SESSION['uniacid'],'id'=>$a['groupid']),'timeout');
				$timeout=intval($timeout)?:6;
				$timeout=3600*$timeout;
				if(time()>$timeout+$a['createtime']){
					$this->model('order')->order_cancel($a['id']);
				}				
			}
		}
	}
}